<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        table{
            width: 700px;
            height: 300px;
            margin:auto;
            border-collapse: collapse;
        }
        th{
            background-color:burlywood;
        }
        td{
            text-align: center;
        }
    </style>
</head>
<body>
    <table border="1" cellpacing="0" >
    <tr>
      <th >
        <input type="checkbox"   class="checkall">全选</
      </th>
      <th>商品</th>
      <th>商家</th>
      <th>价格</th>
    </tr>
    <tr>
      <td>
        <input type="checkbox"  class="ck">
      </td>
      <td>小米手机</td>
      <td>小米</td>
      <td>￥4999</td>
    </tr>
    <tr>
      <td>
        <input type="checkbox"  class="ck">
      </td>
      <td>小米净水器</td>
      <td>小米</td>
      <td>￥1999</td>
    </tr>
    <tr>
      <td>
        <input type="checkbox" class="ck">
      </td>
      <td>小米电视</td>
      <td>小米</td>
      <td>￥5999</td>
    </tr>
</table>
<script>
    const s=document.querySelector('.checkall')
    const d=document.querySelectorAll('.ck')
    s.addEventListener('click',function(){
      for(let i=0;i<s.length;i++){
        
      }
    })
    
    




</script>
    
</body>
</html>